<style src="./user-list.css"scoped ></style>
<template>
   <div class="sec-top row">
    <form class="form-inline col-sm-8" @submit.prevent="getList">
      <div class="form-group form-group-sm">
        <!--<select class="form-control" v-model="searchType">
          <option value="1" selected>手机号</option>
          <option value="2">活动id</option>
          <option value="3">订单状态</option>
        </select>-->
        <label>手机号:</label>
        <input type="text" class="form-control" v-model="phone" placeholder="">
        <label>活动id:</label>
        <input type="text" class="form-control" v-model="activityId" placeholder="">
        <label>订单状态:</label>
        <select class="form-control" v-model="status">
          <option value="" selected>全部</option>
          <option value="ORDER" >已下单</option>
          <option value="成功">成功</option>
          <option value="PROCESS">处理中</option>
          <option value="DELAY">延时处理</option>
          <option value="失败">失败</option>
          <option value="INVALID">无效</option>
        </select>
        <input type="submit" class="btn btn-sm btn-primary" value="搜索">
      </div>
    </form>
    <div class="col-sm-4 text-right">
      <input type="button" class="btn btn-sm btn-primary"  @click="charge()" value="下单">
      <!--当前账户余额：<span v-text="account">***</span>-->
    </div>
  </div>
  <table class="table table-bordered table-hover">
    <caption>订单列表</caption>
    <thead>
      <tr>
        <th class="col-sm-0.5">订单号</th>
        <th class="col-sm-0.5">活动id</th>
        <th class="col-sm-1">流水号</th>
        <th class="col-sm-1">充值手机号</th>
        <th class="col-sm-0.5">充值流量(M)</th>
        <th class="col-sm-1">下单请求返回码</th>
        <!--<th class="col-sm-1.5">平台下单时间</th>-->
        <th class="col-sm-0.5">下单人</th>
        <th class="col-sm-0.5">订单状态</th>
        <th class="col-sm-1.5">更新时间</th>
        <th class="col-sm-1.5">创建时间</th>
        <th class="col-sm-1.5"></th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in DataflowList">
        <td>{{item.id}}</td>
        <td>{{item.activityId}}</td>
        <td>{{item.streamId}}</td>
        <td>{{item.phone}}</td>
        <td>{{item.data}}</td>
        <td>{{item.retCode}}</td>
        <!--<td>{{item.orderTime}}</td>-->
        <td>{{item.operator}}</td>
        <td>{{item.status}}</td>
        <td>{{item.updateTime}}</td>
        <td>{{item.createTime}}</td>
        <td class="text-right">
          <!--<button v-if="item.status !== 'SUCCESS' && item.status !== 'DELAY' && (+item.retCode !==0 || item.status !== 'INVALID') " class="btn btn-sm btn-primary" @click="updateOrder(item.id)">更新</button>-->
          <button v-if="item.status !== '成功' && item.status !== 'INVALID'" class="btn btn-sm btn-primary" @click="invalidOrder(item)">失效</button>
        </td>
      </tr>
    </tbody>
  </table>
  <vue-confirm :show-confirm.sync="showConfirm" :method="reCharge" txt="失效成功，是否重新下单"></vue-confirm>
  <charge-dataflow :show-charge.sync="showCharge" :item.sync="item" title="下单"></charge-dataflow>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>

<script type="text/javascript" src="./user-list.js"></script>
